﻿je_north_german_unification = { #Replace with DVG specific when able
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"

	is_shown_when_inactive = {
		country_has_primary_culture = cu:north_german
		OR = {
			country_tier = kingdom
			country_tier = principality
			country_tier = grand_principality
			country_tier = city_state
		}
	}

	possible = {
		country_rank >= rank_value:major_power
		has_technology_researched = nationalism
		is_subject = no
	}

	complete = {
		hidden_trigger = {
			has_variable = je_unification_progress
		}
		calc_true_if = {
			owns_entire_state_region = STATE_BRANDENBURG #DVG
			owns_entire_state_region = STATE_POMERANIA
			owns_entire_state_region = STATE_EAST_FRISIA #DVG
			owns_entire_state_region = STATE_WESTPHALIA
			owns_entire_state_region = STATE_ANHALT
			#owns_entire_state_region = STATE_RHINELAND
			#owns_entire_state_region = STATE_NORTH_RHINE
			owns_entire_state_region = STATE_SCHLESWIG_HOLSTEIN
			owns_entire_state_region = STATE_HANNOVER
			owns_entire_state_region = STATE_THURINGIA #DVG
			owns_entire_state_region = STATE_SAXONY
			#owns_entire_state_region = STATE_HESSE
			owns_entire_state_region = STATE_MECKLENBURG
			#owns_entire_state_region = STATE_ELBE
			#owns_entire_state_region = STATE_BRUNSWICK
			#owns_entire_state_region = STATE_SILESIA
			#owns_entire_state_region = STATE_WEST_PRUSSIA
			#owns_entire_state_region = STATE_EAST_PRUSSIA
			#owns_entire_state_region = STATE_POSEN
			amount >= 8
		}
	}

	on_monthly_pulse = {
		events = {
			german_unification.2 # confederation
			#german_unification.3 # Bismarck
		}
		effect = {
			if = { 
				limit = { NOT = { has_variable = je_unification_progress } } 
				set_variable = je_unification_progress
			}
		}
	}

	on_complete = {
		if = {
			limit = {
				NOT = {
					exists = c:BOH
					this = c:BOH
				}
			}
			trigger_event = { id = german_unification.1 } # North German Confederation
		}
		remove_variable = je_unification_progress
	}

	status_desc = {
		first_valid = {
			triggered_desc = {
				desc = je_north_german_status
			}
		}
	}

	weight = 100
}

je_german_unification = {
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"

	is_shown_when_inactive = {
		OR = {
			country_has_primary_culture = cu:north_german
			country_has_primary_culture = cu:south_german
			country_has_primary_culture = cu:rheinish #DVG
		}
	}

	possible = {
		country_rank >= rank_value:major_power
		has_technology_researched = pan-nationalism
		is_subject = no
	}

	complete = {
		hidden_trigger = {
			has_variable = je_unification_progress
		}
		calc_true_if = {
			amount >= 20 #DVG
			owns_entire_state_region = STATE_BRANDENBURG #DVG
			owns_entire_state_region = STATE_POMERANIA
			owns_entire_state_region = STATE_EAST_FRISIA #DVG
			owns_entire_state_region = STATE_WESTPHALIA
			owns_entire_state_region = STATE_ANHALT
			owns_entire_state_region = STATE_RHINELAND
			owns_entire_state_region = STATE_NORTH_RHINE
			owns_entire_state_region = STATE_SCHLESWIG_HOLSTEIN
			owns_entire_state_region = STATE_HANNOVER
			owns_entire_state_region = STATE_THURINGIA #DVG
			owns_entire_state_region = STATE_SAXONY
			owns_entire_state_region = STATE_HESSE
			owns_entire_state_region = STATE_MECKLENBURG
			owns_entire_state_region = STATE_ALSACE #DVG
			owns_entire_state_region = STATE_WURTTEMBERG
			owns_entire_state_region = STATE_BADEN
			owns_entire_state_region = STATE_BAVARIA
			owns_entire_state_region = STATE_FRANCONIA
			#DVG
			owns_entire_state_region = STATE_PALATINATE
			owns_entire_state_region = STATE_WEST_SWITZERLAND
			owns_entire_state_region = STATE_EAST_SWITZERLAND
			owns_entire_state_region = STATE_AUSTRIA
			owns_entire_state_region = STATE_STYRIA
			owns_entire_state_region = STATE_TYROL
			#owns_entire_state_region = STATE_ELBE
			#owns_entire_state_region = STATE_BRUNSWICK
			#owns_entire_state_region = STATE_TYROL
			#owns_entire_state_region = STATE_SILESIA
			#owns_entire_state_region = STATE_WEST_PRUSSIA
			#owns_entire_state_region = STATE_EAST_PRUSSIA
			#owns_entire_state_region = STATE_POSEN
			#owns_entire_state_region = STATE_ALSACE_LORRAINE
		}
	}

	on_monthly_pulse = {
		events = {
			german_unification.2 # confederation
		}
		effect = {
			if = { 
				limit = { NOT = { has_variable = je_unification_progress } } 
				set_variable = je_unification_progress
			}
		}
	}

	on_complete = {
		trigger_event = { id = german_unification.4 } # German Unification
		remove_variable = je_unification_progress
	}

	status_desc = {
		first_valid = {
			triggered_desc = {
				desc = je_german_status
				trigger = {
					OR = {
						country_tier = kingdom
						country_tier = principality
					}
				}
			}
		}
	}

	invalid = {
		country_has_primary_culture = cu:hungarian
	}

	weight = 100
}
